PROJECT_ROOT=$(pwd)

# NNRT动态库路径(2选1)
# 1、用户目录
# NNRT_PATH=/home/HwHiAiUser/Ascend/nnrt/

# 2、ROOT用户
NNRT_PATH=/usr/local/Ascend/nnrt

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PROJECT_ROOT/3rdparty/ffmpeg3.4.5_arm64/lib/
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PROJECT_ROOT/3rdparty/opencv4.3.0_arm64/lib/
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$NNRT_PATH/latest/aarch64-linux/lib64/

# 测试用例(stream: 读流测试；stress_test: 压力测试)
DEMO=stream
# 模型路径
MODEL_PATH=$PROJECT_ROOT/weight/yolov5s_bs1_aipp.om
# 模型类别标签
LABEL_PATH=$PROJECT_ROOT/data/coco.txt
# 模型输入大小
INPUT_SIZE=640
# 视频流路径
STREAM_PATH=$PROJECT_ROOT/asset/cross_road.mp4
# 昇腾设备ID
DEVICE_ID=0
# 是否显示
SHOW=0
# 是否保存(压力测试模式此参数无效)
SAVE=1

cd build/
chmod a+x ./yolov5_ascend

./yolov5_ascend $DEMO $MODEL_PATH $INPUT_SIZE $LABEL_PATH $STREAM_PATH $DEVICE_ID $SHOW $SAVE
